<template>
	<view>
		<view class="box or" v-if="partner!=''">
			<image :src="partner.head_portrait" class="img"></image>
			<view class="name">合伙人</view>
			<view style="font-size: 42rpx;"><text style="margin-right: 40rpx;" >{{partner.nickname}}</text><text @click="phone(partner.mobile)">{{partner.mobile}}</text></view>
		</view>
		<view class="box bu" v-if="agent!=''">
			<image :src="agent.head_portrait" class="img"></image>
			<view class="name">服务商</view>
			<view style="font-size: 42rpx;"><text style="margin-right: 40rpx;" >{{agent.nickname}}</text><text @click="phone(agent.mobile)">{{agent.mobile}}</text></view>
		</view>
		<view v-if="agent==''&&partner==''">
			<image src="../../../static/my-img/nobuy.png" class="noimg"></image>
			<view class="kefu">暂无合伙人和服务商</view>
			<view class="kefu">请联系客服</view>
		</view>
	</view>
</template>

<script>
	import {buyVip} from"@/api/userInfo.js"
	export default{
		data(){
			return{
				partner:{},
				agent:{}
			}
		},
		onLoad() {
			this.getinfo()
		},
		methods:{
			getinfo(){
				this.$post(buyVip).then(r => {
					this.partner=r.data.partner;
					this.agent=r.data.agent;
					
					console.log(r)
				}).catch(err => {
					console.log(err);
				})
			},
			phone(e){
				uni.makePhoneCall({
				    phoneNumber: e //仅为示例
				});
			}
		}
	}
</script>

<style>
	.kefu{
		font-size: 30rpx;
		color: #333;
		font-weight: 600;
		text-align: center;
	}
	.noimg{
		width: 310rpx;
		height: 260rpx;
		margin-left: 220rpx;
		margin-top: 140rpx;
	}
	.img{
		width: 152rpx;
		height: 152rpx;
		border-radius: 152rpx;
		margin-bottom: 30rpx;
	}
	.name{
		font-size: 54rpx;
	}
	.box{
		width: 690rpx;
		height: 518rpx;
		opacity: 1;
		border-radius: 12rpx;
		margin-left: 30rpx;
		margin-top: 30rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		color: #FFFFFF;
		font-size: 42rpx;
	}
	.or{
		background: linear-gradient(226deg, #FBB000 0%, #E88018 100%);
	}
	.bu{
		background: linear-gradient(226deg, #538DF2 0%, #18A1E8 100%);

	}
</style>
